package com.zzyl.task;

import com.zzyl.service.ReservationService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

@Slf4j
@Component
public class ReservationTask {
    @Autowired
    private ReservationService reservationService;

    /**
     * 定时任务 查询预约是否过期 如果过期更改状态
     */
    @Scheduled(cron = "0 10,40 * * * ?")
    public void reservationTask() {
        log.info("正在进行定时任务...");
        reservationService.overDue();
    }
}
